/**
 * Created by Yu Jin Xian on 2016/12/13.
 */
var express = require('express');
var handlebars = require('express3-handlebars').create({
    defalutLayout: 'main',
    helpers: {
        section: function (name, options) {
            if (!this.sections) {
                this.sections = {};
            }
            this.sections[name] = options.fn(this);
            return null;
        }
    }
});

var app = express();
app.engine('handlebars', handlebars.engine);
app.set('view engine', 'handlebars');

app.get('/jquerytest', function (req, res) {
    res.render('jquerytest');
});

app.listen(3000, function () {
    console.log('http://localhost:3000/jquerytest');
});